package com.yswy.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("支付宝支付记录表")
@TableName(value = "pay_order_zfb_log")
public class PayOrderZfbLog {
	@TableId(type = IdType.AUTO)
	private Long id;
	@ApiModelProperty("order_id 订单ID ")
	private String orderId;
	@ApiModelProperty(" alitradeno 支付宝订单ID  ")
	private String alitradeno;
	@ApiModelProperty("trade_str 拉起支付字符串 ")
	private String tradeStr;
	@ApiModelProperty("callback_parameter 回调成功数据 ")
	private String callbackParameter ;
	@ApiModelProperty("周期扣款的 productCode（周期扣款 CYCLE_PAY_AUTH  ， 商家代扣 GENERAL_WITHHOLDING）")
	private String productCode ;
	@ApiModelProperty("app_id appID app_id")
	private String appId;
	@ApiModelProperty("public_key  支付宝公钥 ")
	private String publicKey;
	@ApiModelProperty("private_key Java私钥 ")
	private String privateKey;
	@ApiModelProperty("sing_type 加签方式 0 公钥私钥   1 私钥证书 ")
	private Integer singType;
	@ApiModelProperty("cert_path 应用公钥证书路径")
	private String certPath;
	@ApiModelProperty("public_cert_path 支付宝公钥证书路径")
	private String publicCertPath;
	@ApiModelProperty("root_cert_path 支付宝根证书路径")
	private String rootCertPath;
	@ApiModelProperty("callback_url 回调地址")
	private String callbackUrl;
	@ApiModelProperty("state 订单状态")
	private int state;
	@ApiModelProperty("state_str 订单状态")
	private String stateStr;
	@ApiModelProperty("支付类型  0 会员购买  1 话费优惠卷购买   2 话费充值")
	private Integer payType;
	@ApiModelProperty("uid 用户ID")
	private String uid;
	@ApiModelProperty("channel_ip 下单 Ip")
	private String channelIp;
	@ApiModelProperty("recharge_count 付款金额")
	private int rechargeCount;
	@ApiModelProperty("item_info 商品信息")
	private String itemInfo;
	@ApiModelProperty("create_time 创建时间")
	private Date createTime;
	@ApiModelProperty("refund_time 回调时间")
	private Date refundTime;





	public PayOrderZfbLog(ZfbPayKey zfbPayKey){
		this.appId = zfbPayKey.getAppId();
		this.publicKey = zfbPayKey.getZfbKey();
		this.privateKey = zfbPayKey.getJavaKey();
		this.singType = zfbPayKey.getSingType();
		this.certPath = zfbPayKey.getCertPath();
		this.publicCertPath = zfbPayKey.getPublicCertPath();
		this.rootCertPath = zfbPayKey.getRootCertPath();
	}
}
